package com.ruoyi.violate.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.violate.mapper.ViolateShopMapper;
import com.ruoyi.violate.domain.ViolateShop;
import com.ruoyi.violate.service.IViolateShopService;

/**
 * 商铺Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-29
 */
@Service
public class ViolateShopServiceImpl implements IViolateShopService 
{
    @Autowired
    private ViolateShopMapper violateShopMapper;

    /**
     * 查询商铺
     * 
     * @param id 商铺主键
     * @return 商铺
     */
    @Override
    public ViolateShop selectViolateShopById(Long id)
    {
        return violateShopMapper.selectViolateShopById(id);
    }

    /**
     * 查询商铺列表
     * 
     * @param violateShop 商铺
     * @return 商铺
     */
    @Override
    public List<ViolateShop> selectViolateShopList(ViolateShop violateShop)
    {
        return violateShopMapper.selectViolateShopList(violateShop);
    }

    /**
     * 新增商铺
     * 
     * @param violateShop 商铺
     * @return 结果
     */
    @Override
    public int insertViolateShop(ViolateShop violateShop)
    {
        violateShop.setCreateTime(DateUtils.getNowDate());
        return violateShopMapper.insertViolateShop(violateShop);
    }

    /**
     * 修改商铺
     * 
     * @param violateShop 商铺
     * @return 结果
     */
    @Override
    public int updateViolateShop(ViolateShop violateShop)
    {
        violateShop.setUpdateTime(DateUtils.getNowDate());
        return violateShopMapper.updateViolateShop(violateShop);
    }

    /**
     * 批量删除商铺
     * 
     * @param ids 需要删除的商铺主键
     * @return 结果
     */
    @Override
    public int deleteViolateShopByIds(Long[] ids)
    {
        return violateShopMapper.deleteViolateShopByIds(ids);
    }

    /**
     * 删除商铺信息
     * 
     * @param id 商铺主键
     * @return 结果
     */
    @Override
    public int deleteViolateShopById(Long id)
    {
        return violateShopMapper.deleteViolateShopById(id);
    }
}
